package com.foton.logistic.model.order;


import com.foton.logistic.util.tool.StringUtil;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName="location")
public class LocationEntity {
    @DatabaseField(id=true)
    public String id;//主键
    @DatabaseField
    public String result="0";//成功值：0是失败，1是成功,2是成功但是间隔小于20
    @DatabaseField
    public String msg="";//错误信息
    @DatabaseField
    public String lat="";//纬度
    @DatabaseField
    public String lng="";//经度
    @DatabaseField
    public double radius = 0;//精密度
    @DatabaseField
    public String address ="";//地址
    @DatabaseField
    public String city ="";//城市
    @DatabaseField
    public String city_code ="";//城市编号
    @DatabaseField
    public String coorType="";//坐标类型
    @DatabaseField
    public String create_time ="";//创建时间
    @DatabaseField
    public String update_time="";//更新时间
    @DatabaseField
    public String locType="";//定位方式：61GPS定位结果,161网络定位结果,66离线定位结果
    @DatabaseField
    public String localId ="";//本地订单ID
    @DatabaseField
    public String isUploaded ="0";//是否已经上传
    @DatabaseField
    public String reverse1 ="";//预留字段1
    @DatabaseField
    public String reverse2 ="";//预留字段2
    @DatabaseField
    public String reverse3 ="";//预留字段3
    @DatabaseField
    public String reverse4 ="";//预留字段4
    //外键
//    @DatabaseField
//    public String bill_no="";//订单编号


    public LocationEntity() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCity_code() {
        return city_code;
    }

    public void setCity_code(String city_code) {
        this.city_code = city_code;
    }

    public String getCoorType() {
        return coorType;
    }

    public void setCoorType(String coorType) {
        this.coorType = coorType;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }


    public String getLocType() {
        return locType;
    }

    public void setLocType(String locType) {
        this.locType = locType;
    }

    public String getLocalId() {
        return localId;
    }

    public void setLocalId(String localId) {
        this.localId = localId;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public String getIsUploaded() {
        return isUploaded;
    }

    public void setIsUploaded(String isUploaded) {
        this.isUploaded = isUploaded;
    }

    public double getLatDouble() {
        if (StringUtil.isEmpty(lat)){
            return 0;
        }
        return Double.parseDouble(lat);
    }

    public double getLngDouble() {
        if (StringUtil.isEmpty(lng)){
            return 0;
        }
        return Double.parseDouble(lng);
    }
}